
document.write('<link rel="icon" type="image/x-icon" href="https://suzhou.xfyun.cn/hera/img/favicon-e30f2b208a8989441f93a044956c2c0e.png" />')
// var http = 'http://szcyjs.maoln.com/cloud'; //接口请求域名
var http = 'http://www.ai-sip.com/cloud'; //接口请求域名
function ajax(url,data,runFun,type){
  $.ajax({
    type : type,//请求方式
    contentType: "application/x-www-form-urlencoded",//"multipart/form-data",//请求的媒体类型
    url : http+'/'+url,//请求地址
    async : true, 
    data : data,
    success : function(res) {
      if(res.code === 1){
        runFun(res.data)
      }else{
        showToast(res.msg);
      }
    },
    complete:function(){
        $('#app').css('opacity',1)
    },
  });
};

function showToast(text){
  $('body').append('<div id="msg"><div class="msg_con">'+text+'</div></div>');
  // setTimeoutRun = setTimeout(function(){
  //   $('#msg').remove()
  // },1500)
}


function getMenuApi(data,runFun){ ajax2(threeHttps+'suzhou-cms/platform/common?platform=suzhou',data,runFun,'GET') }; //获取用户登录信息

function msg(that,text){
  that.$message({
    message: text,
    type: 'success'
  });
}
function err(that,text){
  that.$message({
    message: text,
    type: 'error'
  });
}

//获取参数    
function getId (key) {
    var url = window.location.search;
    var reg = new RegExp("(^|&)" + key + "=([^&]*)(&|$)");
    var result = url.substr(1).match(reg);
    return result ? decodeURIComponent(result[2]) : null;
}
function regM(value){
  var reg = /^1[3|4|5|6|7|8|9][0-9]\d{8}$/;
  return reg.test(value)
}
// 验证手机号
function rulePhone (rule, value, callback){
  if (!value) {
    return callback(new Error('手机号不能为空'));
  } else {
    var reg = /^1[3|4|5|6|7|8|9][0-9]\d{8}$/;
    console.log(reg.test(value));
    if (reg.test(value)) {
      callback();
    } else {
      return callback(new Error('请输入正确的手机号'));
    }
  }
}


